<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%String path = request.getContextPath() ;%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/sys.tld" prefix="sys" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>项目产品报价</title>
    <jsp:include page="../../import.jsp" flush="true" />
</head>
<div id="searchBtnDIV">
    <span id="searchBtn1" class="sq-button sq-button-round"></i>查询</span>
</div>
<script type="text/javascript">
    var s =  $("#searchBtnDIV").hide();//隐藏查询
    var prjId='${prjId}';
    var prjPrdId='${prjPrdId}';
    var prdFlag='${prdFlag}';
    var detailFlag='${detailFlag}';
    var grid = null;
    var ywParam = '${ywParam}';
    var buOrgCd = '${buOrgCd}';
    var isDetail = '${isDetail}';
    var lcvCheck = '${lcvCheck}';
    var lcvCheckLnkCompUrl = '${lcvCheckLnkCompUrl}';

    // 车牌号
    var carNo = '${carNo}';

    // 项目类型，如车抵贷线下CDDYWUL
    var prjTypCd = '${prjTypCd}';

    $(function () {
        initGrid();//grid
        if(detailFlag=="true"){
            $("#removeBtn").hide();
            $("#addBtn").hide();
            $("#addGPSCardBtn").hide();
        }
    });

    //初始化列表
    function initGrid(){
        var manager = null;
        var params = {};
        if(prdFlag){
            params.prjPrdId = prjPrdId;
        }else{
            params.prjId = prjId;
        }
        manager =  $("#grid").ligerGrid({
            url: '<%=path%>/project/prjprddtl/initList.do',
            method : 'get',
            parms:params,
            columns: [
                { display: '产品名称', name: 'prdNm', minWidth: 100,
                    render: function (rowdata, rowindex, value, column) {
                        value ==null?"":value;
                        var h = '';
                        h+='<a  href="javascript:prdDetailBtn(';
                        h+="'"+rowdata.id+"',";
                        h+="'"+rowdata.prjPrdId+"'";
                        h+=')">'+value+'</a>'
                        return h;
                    },
                    enabledSort:true},
                { display: '车辆型号', name: 'prdMdl', minWidth: 140,enabledSort:true},
                getPaySchNoColumn(),
                { display: '挂靠公司名称', name: 'lnkCompNm', minWidth: 100 ,
                    render: function (rowdata, rowindex, value, column) {
                        value ==null?"":value;
                        var h = '';
                        if(value){
                            if(rowdata.prjLnkCompVO){
                                if(rowdata.prjLnkCompVO.audStsCd==FlowConstant.FLOW_CHECK_STATE_NON||rowdata.prjLnkCompVO.audStsCd==FlowConstant.FLOW_CHECK_STATE_IN
                                    ||rowdata.prjLnkCompVO.audStsCd==CommonConstant.C_AUD_CHANGEADNWAY_CODE){
                                    h+='<i class="ico_flasher"></i>';
                                }
                            }
                            h+='<a href="javascript:detailBtn(';
                            h+="'"+rowdata.lnkCompId+"'";
                            h+=')">'+value+'</a>'

                        }
                        return h;
                    },
                    enabledSort:true},
                getLnkRiskWarnRecColumn(),
                getEverRateColumn(),
                getPotRateColumn(),
                { display: '合格证编号', name: 'certNo',
                    render: function (rowdata, rowindex, value, column) {
                        var h = '';
                        if(value){
                            h+='<a  href="javascript:detailVehBtn(';
                            h+="'"+rowdata.actPrdId+"',";
                            h+="'"+rowdata.id+"'";
                            h+=')">'+value+'</a>'
                        }

                        return h;
                    },
                    minWidth: 180, enabledSort:true},
                { display: 'GPS卡号1', name: 'gpsCardNo', minWidth: 160, editor: {type: 'text'}, enabledSort:true},
                { display: 'GPS卡号2', name: 'gpsCardNo2', minWidth: 160,editor: {type:'text'}, enabledSort:true},
                { display: 'GPS卡号3', name: 'gpsCardNo3', minWidth: 160,editor: {type:'text'}, enabledSort:true},
                getLicenseNum(),
                getVinColumn(),
                { display: 'VIN校验结果', name: 'vinValidResNm', minWidth: 140,enabledSort:true},
                { display: 'VIN校验结果', name: 'vinValidRes', hide:true, minWidth: 140,enabledSort:true},
                { display: '轻卡审核结果', name: 'lnkCompLcvStatus', minWidth: 140, enabledSort:true, render: function (rowdata, rowindex, value, column) {
                        var h = '';
                        if(value && "0"==value){
                            h = '<span color="red">审核未通过</span>';
                        }else if(value && "1"==value){
                            h = '<span color="green">审核通过</span>';
                        }
                        return h;
                    }},
                {
                    display: '操作',
                    isSort: false,
                    width: 300,
                    render: function (rowdata, rowindex, value){
                        var h="";
                        if(detailFlag!="true"){
                            <sys:FlowFrmAth preTaskIds="${preTaskIds}" athCd="addPrjBscInfo" pInstId="${pInstId}">
                            h='<a class="sq-button-hasicon" href="javascript:modifyBtn(';
                            h+="'"+rowdata.id+"',";
                            h+="'"+rowdata.prdTypCd+"'";
                            h+=')"><i class="sqBtnIco_4"></i>修改</a>';
                            </sys:FlowFrmAth>
                        }

                        h+='<a class="sq-button-hasicon" href="javascript:lookBtn(';
                        h+="'"+rowdata.id+"',";
                        h+="'"+rowdata.prdTypCd+"'";
                        h+=')"><i class="sqBtnIco_4"></i>查看</a>';

                        // 轻卡显示
                        if(lcvCheck && !StringUtils.isEmpty(rowdata.lnkCompNm)){
                            h+='<a class="sq-button-hasicon" href="javascript:lookLnkComp(';
                            h+="'"+rowdata.id+"',";
                            h+="'"+rowdata.lnkCompNm+"'";
                            h+=')"><i class="sqBtnIco_4"></i>涉诉报告</a>';

                            // 轻卡
                            if(StringUtils.isNotEmpty(rowdata.lnkCompLcvStatus) && "0"==rowdata.lnkCompLcvStatus){
                                h+='<a class="sq-button-hasicon" href="javascript:lnkCompCheck(';
                                h+="'"+rowdata.id+"',";
                                h+="'"+rowdata.lnkCompId+"',";
                                h+="'"+rowdata.lnkCompLcvStatus+"'";
                                h+=')"><i class="sqBtnIco_4"></i>挂靠审核</a>';
                            }
                        }

                        //项目类型不是车抵贷业务线下和二手车交易贷时显示合格证上传按钮
                        if (detailFlag!="true") {
                            if (ProjectConstant.PRJ_TYP_CD_CDDYWUL != prjTypCd && ProjectConstant.PRJ_TYP_CD_ESCJYD != prjTypCd && ProjectConstant.PRJ_TYP_CD_OWNJYD != prjTypCd) {
                                h+='<a class="sq-button-hasicon" href="javascript:certNoUploadBtn(';
                                h+="'" + rowdata.id + "',";
                                h+="'" + rowdata.actPrdId + "',";
                                h+=')"><i class="sqBtnIco_4"></i>合格证上传</a>';
                            }

                            h+='<a class="sq-button-hasicon" href="javascript:uploadInvoice(';
                            h+="'"+rowdata.id+"',";
                            h+="'"+rowdata.paySchNo+"',";
                            h+=')"><i class="sqBtnIco_4"></i>发票上传</a>';
                        }

                        return h;
                    }
                }
            ],
            pageSize:100,
            root:'rows',
            record:'total',
            hideLoadButton : true,
            width: '100%',
            height:'100%',
            heightDiff:-2,
            checkbox:true,
            allowUnSelectRow: true,
            alternatingRow: true,
            rownumbers:true,
            enabledEdit: true,
            usePagerOnLessPagesize: true,
        });
        grid = liger.get("grid");
        grid.setHeight(500);


        // 如是产品明细第一条数据的车牌号为空，使用默认带过来的车牌号
//        var gridData = grid.getData();
//        if (gridData[0].licenseNum == null) {
//            grid.updateCell("licenseNum", carNo, gridData[0]);
//        }
    }
    // 列表展示车牌号
    function getLicenseNum() {
        var column;
        if (null != prjTypCd && "" != prjTypCd) {
            if (prjTypCd == 'CDDYWUL') { // 项目类型：车抵贷(线下)
                column = { display: '车牌号', name: 'vehNo', minWidth: 160,editor: {type: 'text', onChanged:validateLicenseNum}, enabledSort:true,
                    render: function (rowdata, rowindex, value){
                        return rowdata.vehNo;
                    }
                };
            }
        }
        return column;
    }

    // 校验车牌号
    function validateLicenseNum(data) {
        var record = data.record;
        var vehNo = record.vehNo;
        // 编辑结束后 将车牌号变成大写
        if (vehNo != null && vehNo != "") {
            grid.updateCell("vehNo", vehNo.toUpperCase(), record);
        }
    }

    function getPaySchNoColumn(){
        var column;
        if(ywParam == 1){
            column ={ display: '支付表号', name: 'paySchNo', minWidth: 140,enabledSort:true,
                render: function (rowdata, rowindex, value){
                    if(StringUtils.isEmpty(rowdata.paySchNo)){
                        return "";
                    }else{
                        return rowdata.paySchNo;
                    }
                }
            };
        }
        return column;
    }

    function getLnkRiskWarnRecColumn(){
        var column;
        if(isDetail == '0'){
            column ={display: '挂靠公司预警状态',isEllipsis:false,align:'center',
                render: function (rowdata, rowindex, value){
                    var h="";
                    if(rowdata.lnkCompId){
                        if(StringUtils.isNotEmpty(rowdata.riskWarnCd) && rowdata.riskWarnCd=="1"){
                            h+="<span style='color:red'>高风险预警</span>";
                        }
                    }
                    return h;
                }
            };
        }
        return column;
    }

    function getEverRateColumn(){
        var column;
        if(isDetail == '0'){
            column ={display: 'Ever逾期率', isEllipsis:false, align:'left', name: 'everRate',
                render: function (rowdata, rowindex, value) {
                    return value + '%';
                }
            };
        }
        return column;
    }

    function getPotRateColumn(){
        var column;
        if(isDetail == '0'){
            column ={display: '时点逾期率', isEllipsis:false, align:'left', name: 'potRate',
                render: function (rowdata, rowindex, value) {
                    return value + '%';
                }
            };
        }
        return column;
    }

    // 校验车架号vin
    function validateVin(data){
        var record = data.record;
        var vin = record.vin;
        if(StringUtils.isEmpty(vin)){
            grid.updateCell("vinValidRes",0,record);
            grid.updateCell("vinValidResNm","未校验",record);
            // record.vinValidRes = 0;
            // record.vinValidResNm = "未校验";
        }else {
            $.ajax({
                type: 'get',
                dataType: 'json',
                data: {vin: vin},
                url: '<%=path%>/project/prjprddtl/validVin.do',
                success: function (msg) {
                    grid.updateCell("vinValidRes",msg.success,record);
                    grid.updateCell("vinValidResNm",msg.info,record);
                    // record.vinValidRes = msg.success;
                    // record.vinValidResNm = msg.info;
                }
            });
        }
    }
    // 获取车架号VIN
    function getVinColumn(){
        var column;
        if(detailFlag!="true"){
            column ={ display: 'VIN', name: 'vin', minWidth: 160, editor: {type: 'text',onChanged:validateVin}, enabledSort:true,
                render: function (rowdata, rowindex, value){
                    return rowdata.vin;
                }
            };

        }else{
            column ={ display: 'VIN', name: 'vin', minWidth: 160,  enabledSort:true,
                render: function (rowdata, rowindex, value){
                    var h="";
                    if(StringUtils.isNotEmpty(rowdata.vin)){
                        h='<a class="sq-button-hasicon" href="javascript:toRePrjPageList(';
                        h+="'vin','"+rowdata.vin+"'";
                        h+=')"><i class="sqBtnIco_1"></i></a>';
                        h+='&nbsp;&nbsp;&nbsp;&nbsp;'+rowdata.vin;
                    }else{
                        h = rowdata.vin;
                    }
                    return h;
                }
            };
        }
        return column;
    }
    //格式化为人民币格式
    function renderAmt(rowdata, rowindex, value) {
        var h="￥" + FormatMoney(value)
        return h;
    }

    //格式化时间
    function renderDate(rowdata, index, value){
        var dateStr = "";
        if(null != value&&value!=''){
            var date = new Date(value);
            dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DD);
        }
        return dateStr;
    }
    ///* 查询 */
    $("#searchBtn1").click(function (event) {
        grid.reload();
    });

    //添加挂靠公司
    function addBtn(){
        var callback = function(){
            grid.reload();
        }
        var selectedRows = grid.getSelectedRows();
        if(selectedRows.length <1){
            $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_SELECT_ONLY_A_ROW, SQ_type: "warring"});
            return;
        }
        var _ids = [];
        var prjId = "";
        for ( var index in selectedRows) {
            prjId = selectedRows[index].prjId
            _ids.push(selectedRows[index].id);
        }
        var ids =	JSON.stringify(_ids);
        $.ligerDialog.open({  title: '添加产品挂靠公司',height: 500,width: 850, url:'<%=path%>/project/prjprddtl/toChooseLnkCompPage.do?ids='+ids+'&prjId='+prjId,callback:callback});
    }

    //修改
    function modifyBtn(id,prdTypCd){
        var hasCarFlag = 0;
        if(null==id){
            top.$.ligerDialog.SQalert({content: "未找到产品明细id",SQ_type: "error"});
            return;
        }
        var callback = function(){
            grid.reload();
        }
        //$.ligerDialog.open({  title: '修改产品明细',height: 500,width: 850, url:'<%=path%>/project/prjprddtl/toChooseLnkCompPage.do?dtlId='+id+'&detailFlag='+false,callback:callback});
        if(prdTypCd=="016"){
            hasCarFlag = 1;
        }
        Add_navTab( 'tab_prj_prd_dtl_info'+id,'修改车辆信息','<%=path%>/project/prjprddtl/toModifyPrjPrdDtlPrdInfoPage.do?detailFlag='+detailFlag+'&dtlId='+id+'&prdTypCd='+prdTypCd+'&ywParam=1'+'&hasCarFlag='+hasCarFlag+'&auth=1',callback);
    }

    //查看
    function lookBtn(id,prdTypCd){
        var hasCarFlag = 0;
        if(null==id){
            top.$.ligerDialog.SQalert({content: "未找到产品明细id",SQ_type: "error"});
            return;
        }
        var callback = function(){
            grid.reload();
        }
        //$.ligerDialog.open({  title: '产品明细详情',height: 500,width: 850, url:'<%=path%>/project/prjprddtl/toChooseLnkCompPage.do?dtlId='+id+'&detailFlag='+true,callback:callback});
        if(ywParam=="1"&&buOrgCd=="00000001"){
            if(prdTypCd=="52"){
                hasCarFlag = 1;
            }
            Add_navTab( 'tab_prj_prd_dtl_info'+id,'车辆信息详情','<%=path%>/project/prjprddtl/toModifyPrjPrdDtlPrdInfoPage.do?detailFlag='+true+'&&dtlId='+id+'&prdTypCd='+prdTypCd+'&ywParam=1'+'&hasCarFlag='+hasCarFlag,callback);
        }else{
            $.ligerDialog.open({  title: '产品明细详情',height: 500,width: 1000, url:'<%=path%>/project/prjprddtl/toModifyPrjPrdDtlCarPrdInfoPage.do?dtlId='+id+'&detailFlag='+true+'&isMust='+false,callback:callback});
        }
    }

    // 挂靠涉诉
    function lookLnkComp(id, lnkCompNm){
        if(null==lnkCompNm){
            top.$.ligerDialog.SQalert({content: "未找到挂靠涉诉名称",SQ_type: "error"});
            return;
        }
        var callback = function(){
            grid.reload();
        }
        $.ligerDialog.open({  title: '挂靠涉诉详情',height: 500,width: 1000, url:lcvCheckLnkCompUrl + lnkCompNm, callback:callback});
    }
    // 挂靠审核
    function lnkCompCheck(pejPrdDtlId, lnkCompId, lnkCompLcvStatus){
        var wait_dialog;
        $.ajax({
            type: 'get',
            dataType: 'json',
            data: {pejPrdDtlId: pejPrdDtlId},
            url: '<%=path%>/project/prjprddtl/checkLcvStatus.do',
            beforeSend: function () {
                wait_dialog = $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING, SQ_type: "waitting"});
            },
            success: function (msg) {
                // grid.updateCell("vinValidRes",msg.success,record);
                // grid.updateCell("vinValidResNm",msg.info,record);
                wait_dialog.close();
                if(msg.success == 1){
                    top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "success"});
                    grid.reload();
                }else{
                    top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
                }
            }
        });
    }

    //合格证上传
    function certNoUploadBtn(id, actPrdId){
        if(null==id){
            top.$.ligerDialog.SQalert({content: "未找到产品明细id", SQ_type: "error"});
            return;
        }
        var callback = function(){
            grid.reload();
        };
        var noLinkButton = true;
        if (StringUtils.isEmpty(actPrdId)) {
            Add_navTab('tab_prj_prd_veh_info_add' + id, '添加合格证', '<%=path%>/project/prjprdvehinfo/toAddPage.do?detailFlag=false' + '&dtlId=' + id + "&noLinkButton=" + noLinkButton, callback);
        } else {
            Add_navTab('tab_prj_prd_veh_info_add' + id, '修改合格证', '<%=path%>/project/prjprdvehinfo/toAddPage.do?detailFlag=false' + '&id=' + actPrdId + '&dtlId=' + id + "&noLinkButton=" + noLinkButton, callback);
        }
    }

    //发票上传
    function uploadInvoice(id,paySchNo){
        if(null==id){
            top.$.ligerDialog.SQalert({content: "未找到产品明细id",SQ_type: "error"});
            return;
        }
        var callback = function(){
            grid.reload();
        }
        Add_navTab( 'tab_prj_prd_invoice_detail'+id,'发票上传','<%=path%>/project/prjPrdInvoice/toListPage.do?detailFlag='+true+'&dtlId='+id+'&paySchNo='+paySchNo+'&ywParam=1',callback);
    }

    function detailBtn(lnkCmpId){
        if(null==lnkCmpId){
            lnkCmpId = "";
        }
        //$.ligerDialog.open({  title: '挂靠公司详情',height: 500,width: 850, url:'<%=path%>/project/prjlnkcomp/toDetailPage.do?id='+lnkCmpId});
        Add_navTab( 'tab_prj_prd_lnk_detail'+lnkCmpId,'挂靠公司详情','<%=path%>/project/prjlnkcomp/toDetailPage.do?id='+lnkCmpId);
    }
    function detailVehBtn(id,dtlId){
        var detailFlag = true;
        Add_navTab( 'tab_prj_prd_veh_info_detail'+id,'合格证详情','<%=path%>/project/prjprdvehinfo/toDetailPage.do?detailFlag='+detailFlag+'&id='+id+'&dtlId='+dtlId);
    }
    //有拆分后的产品明细，显示拆分后的产品明细，否则显示项目产品
    function prdDetailBtn(dtlId,prjPrdId){
        //查询产品明细数据
        $.ajax({
            type: 'get',
            dataType:'json',
            data:{id:dtlId},
            url: '<%=path%>/project/prjprddtl/getPrjPrdDtlPrdInfoById.do',
            success:function(msg){
                if(msg.success == 1){
                    var detailFlag = true;
                    var prdTypCd = '';
                    Add_navTab( 'tab_prj_prd_dtl_info'+dtlId,'车辆信息详情','<%=path%>/project/prjprddtl/toModifyPrjPrdDtlPrdInfoPage.do?detailFlag='+detailFlag+'&dtlId='+dtlId+'&prdTypCd='+prdTypCd);
                }else{
                    var editFlag = true;
                    Add_navTab('tab_prj_prd_info_detail'+prjPrdId,'项目产品详细信息','<%=path%>/project/vehicle/toModifyPage.do?id='+prjPrdId+'&prjId='+prjId+'&detailFlag='+editFlag);
                }
            }
        });

    }

    function iframeResize () {
        if (parent.mainApp) {
            parent.mainApp.parentTab.onResize();
        };
    }
    //所选信息
    function removeBtn(){
        var selectedRows = grid.getSelectedRows();
        if(selectedRows.length <1){
            $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_SELECT_ONLY_A_ROW, SQ_type: "warring"});
            return;
        }
        var _ids = [];
        for ( var index in selectedRows) {
            _ids.push(selectedRows[index].id);
        }
        $.ligerDialog.confirm(LogUtils.LOG_CMM_DELETE_CONFIRM, function (flag) {
            if(flag == false)return;
            $.ajax({
                type: 'post',
                dataType:'json',
                data:{ids:JSON.stringify(_ids)},
                url: '<%=path%>/project/prjprddtl/removePrdDtlLnkCompByIds.do',
                success:function(msg){
                    if(msg.success == 1){
                        grid.reload();
                    }else{
                        top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
                    }
                }
            });
        });

    }

    /**
     * 检查是否有填写错误的VIN码
     * @param list
     * @returns {boolean}
     */
    function checkVinValidate(list){
        if(list){
            for (var item of list ){
                // 有值就必须验证正确，但是可以不填
                if(item.vinValidRes){
                    if(StringUtils.isNotEmpty(item.vin) && item.vinValidRes != "1"){
                        return false;
                    }
                }
            }
        }
        return true;
    }
    //保存
    function addGPSCardBtn(){
        var gridData = grid.getData();
        // VIN校验检查
        if(!checkVinValidate(gridData)){
            top.$.ligerDialog.SQalert({content: "VIN校验失败！",SQ_type: "error"});
            return false;
        }

        for ( var i=0; i<gridData.length;i++) {
            var obj = gridData[i];
            var gps1 = obj.gpsCardNo;
            var gps2 = obj.gpsCardNo2;
            var gps3 = obj.gpsCardNo3;
            /* 	  if(gps1){
                    if(gps1.length!=8&&gps1.length!=11){
                     top.$.ligerDialog.SQalert({content: "GPS1卡号仅支持维护8位或者11位!",SQ_type: "error"});
                 return false ;
                 }
                  }
                  if(gps2){
                    if(gps2.length!=8&&gps2.length!=11){
                     top.$.ligerDialog.SQalert({content: "GPS2卡号仅支持维护8位或者11位!",SQ_type: "error"});
                 return false ;
                 }
                  } */
        }


        var licenseNumArray = new Array();
        for ( var i=0; i<gridData.length;i++) {
            var obj = gridData[i];

            var license = obj.vehNo;
            licenseNumArray.push(license);

        }

        // 项目类型为：车抵贷业务线下，车牌号校验
        // 1、车抵贷业务(线下)，车牌号必填
        // 2、车牌号重复校验，仅校验页面输入的车牌号不重复即可
        if (prjTypCd == 'CDDYWUL') {
            if (licenseNumArray.length < gridData.length) {
                top.$.ligerDialog.SQalert({content: "未填写车牌号",SQ_type: "error"});
                return false;
            }
        }


        var data = {};
        var url = '<%=path%>/project/prjprddtl/modifyGpsInfos.do';
        data["prjPrdDtlInfoList"] = JSON.stringify(gridData);
        data["prjTypCd"] = prjTypCd;
        data["prjId"] = prjId;
        var wait_dialog;
        $.ajax({
            type: 'post',
            dataType:'json',
            data:data,
            url: url,
            beforeSend: function(){
                wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
            },
            success:function(msg){
                wait_dialog.close();
                if(msg.success == 1){
                    top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "success"});
                    grid.reload();
                }else{
                    top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
                }
            }
        });

    }
    //查询项目信息(查重)
    function toRePrjPageList(type,value){
        var _cstId = '${cstId}';
        var _cstTypCd = '${cstTypCd}';
        if(StringUtils.isEmpty(_cstTypCd)){
            _cstTypCd=1;
        }
        if( StringUtils.isEmpty(prjId) || StringUtils.isEmpty(_cstTypCd))return;
        Add_navTab('tab_re_prj'+'-'+type+_cstId,'查重页面','<%=path%>/project/prjbscinfo/toRePrjListPage.do?id='+_cstId+'&cstTypCd='+_cstTypCd+'&prjId='+prjId+'&type='+type+'&value='+value);
    }

</script>

<body class="iframeBody">
<div class="Wrapper">
    <div id="pageInTab" class="pageInTab">
        <div class="searchArea">
            <form id="searchBar">
                <div class="fieldset1 clearFix">
                    <div class="clearFix"></div>
                    <div class="btnsBox">
                        <sys:FlowFrmAth preTaskIds="${preTaskIds}" athCd="addPrjBscInfo" pInstId="${pInstId}">
                            <span id="addBtn" onclick="addBtn();" class="sq-button sq-button-round"><!-- <i class="sqBtnIco_5"></i> -->产品挂靠</span>
                            <span id="removeBtn" onclick="removeBtn();" class="sq-button sq-button-round"><!-- <i class="sqBtnIco_5"></i> -->移除挂靠</span>
                            <span id="addGPSCardBtn" onclick="addGPSCardBtn();" class="sq-button sq-button-round"><!-- <i class="sqBtnIco_5"></i> -->保存</span>
                        </sys:FlowFrmAth>
                    </div>
                </div>
            </form>
        </div>
        <div id="grid" class="sq-grid"></div>

    </div>
</div>
</div>
</body>
</html>